package tyk;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import tyk.config.SpringConfig;
import tyk.pojo.People;
import tyk.proxy.UserServiceProxy;

/**
 * Hello world!
 *
 */
public class Main
{
    public static void main( String[] args )
    {
        ApplicationContext context = new AnnotationConfigApplicationContext(SpringConfig.class);
        People people1 = context.getBean("people1",People.class);
        System.out.println(people1);
        System.out.println("-----------使用@Resource完成自动装配-----------------");
        tyk.resource.People people2 = (tyk.resource.People) context.getBean("people2");
        System.out.println(people2);
        System.out.println("-----------静态代理-----------------");
        UserServiceProxy userServiceProxy = (UserServiceProxy) context.getBean("userServiceProxy");
        userServiceProxy.add();
        userServiceProxy.delete();
        userServiceProxy.update();
        userServiceProxy.query();
    }
}
